/**
 * 
 */
package com.base.myproject.client.busi.ClientEnv;

import java.io.Serializable;
import java.util.Date;

/**
 * 负责单个会员（客户）的增加，删除，查询
 * 
 * @author zgw 2009-12-9 下午06:14:05 javazgw@gmail.com
 */
public class CcodeSync extends SyncObject implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 4886102975897758507L;

	String icode, ccode, s_cardno="", cname="", sex="", s_mobil="", s_mark="", createbcode="",
			createbname="", updatebcode="", updatebname="", password="";
	Date createdate, updatedate;

	public CcodeSync() {

	}

	/**
	 * 查询 只能服务器端运行
	 */
	public String query() {
		return "";
	}

	/**
	 * 保存 只能服务器端运行
	 * 
	 * @return
	 */
	public String save() {

		return "";
	}

	/**
	 * 删除 只能服务器端运行
	 * 
	 * @return
	 */
	public String delete() {
		return "";
	}

	/**
	 * 添加 只能服务器端运行
	 * 服务器端会见此sql放到存储过程里执行
	 * exec(@updatesql +' where icode =@@identity')
	 * @return
	 */
	public String add()
	{
		
	//	return "insert into ccode (ccode,cname,s_cardno,s_mobil,s_mark,createbcode,createbname,createdate) values(@@IDENTITY+1,'"+cname+"','"+s_cardno+"','"+s_mobil+"','"+s_mark+"','"+createbcode+"','"+createbname+"',getdate())";
	
		if(password==null||password.trim().equals(""))
		{
			return "update ccode set ccode=icode,s_cardno='"+s_cardno+"', cname='"+cname+"',s_sex='"+sex+"',s_mobil='"+s_mobil+"', s_mark='"+s_mark+"',createbcode='"+createbcode+"',createbname='"+createbname+"',createdate=getdate()";
		}
		else
		return "update ccode set ccode=icode,s_cardno='"+s_cardno+"', cname='"+cname+"',s_sex='"+sex+"',s_mobil='"+s_mobil+"', s_mark='"+s_mark+"',password='"+password+"',createbcode='"+createbcode+"',createbname='"+createbname+"',createdate=getdate()"; 
		
	}

	/**
	 * @return the icode
	 */
	public String getIcode() {
		return icode;
	}

	public String getS_cardno() {
		return s_cardno;
	}

	public void setS_cardno(String sCardno) {
		s_cardno = sCardno;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	/**
	 * @param icode
	 *            the icode to set
	 */
	public void setIcode(String icode) {
		this.icode = icode;
	}

	/**
	 * @return the ccode
	 */
	public String getCcode() {
		return ccode;
	}

	/**
	 * @param ccode
	 *            the ccode to set
	 */
	public void setCcode(String ccode) {
		this.ccode = ccode;
	}

	/**
	 * @return the cname
	 */
	public String getCname() {
		return cname;
	}

	/**
	 * @param cname
	 *            the cname to set
	 */
	public void setCname(String cname) {
		this.cname = cname;
	}

	/**
	 * @return the sex
	 */
	public String getSex() {
		return sex;
	}

	/**
	 * @param sex
	 *            the sex to set
	 */
	public void setSex(String sex) {
		this.sex = sex;
	}

	/**
	 * @return the s_mobil
	 */
	public String getS_mobil() {
		return s_mobil;
	}

	/**
	 * @param s_mobil
	 *            the s_mobil to set
	 */
	public void setS_mobil(String s_mobil) {
		this.s_mobil = s_mobil;
	}

	/**
	 * @return the s_mark
	 */
	public String getS_mark() {
		return s_mark;
	}

	/**
	 * @param s_mark
	 *            the s_mark to set
	 */
	public void setS_mark(String s_mark) {
		this.s_mark = s_mark;
	}

	/**
	 * @return the createbcode
	 */
	public String getCreatebcode() {
		return createbcode;
	}

	/**
	 * @param createbcode
	 *            the createbcode to set
	 */
	public void setCreatebcode(String createbcode) {
		this.createbcode = createbcode;
	}

	/**
	 * @return the createbname
	 */
	public String getCreatebname() {
		return createbname;
	}

	/**
	 * @param createbname
	 *            the createbname to set
	 */
	public void setCreatebname(String createbname) {
		this.createbname = createbname;
	}

	/**
	 * @return the updatebcode
	 */
	public String getUpdatebcode() {
		return updatebcode;
	}

	/**
	 * @param updatebcode
	 *            the updatebcode to set
	 */
	public void setUpdatebcode(String updatebcode) {
		this.updatebcode = updatebcode;
	}

	/**
	 * @return the updatebname
	 */
	public String getUpdatebname() {
		return updatebname;
	}

	/**
	 * @param updatebname
	 *            the updatebname to set
	 */
	public void setUpdatebname(String updatebname) {
		this.updatebname = updatebname;
	}

	/**
	 * @return the createdate
	 */
	public Date getCreatedate() {
		return createdate;
	}

	/**
	 * @param createdate
	 *            the createdate to set
	 */
	public void setCreatedate(Date createdate) {
		this.createdate = createdate;
	}

	/**
	 * @return the updatedate
	 */
	public Date getUpdatedate() {
		return updatedate;
	}

	/**
	 * @param updatedate
	 *            the updatedate to set
	 */
	public void setUpdatedate(Date updatedate) {
		this.updatedate = updatedate;
	}

}
